#include "sph_system.h"

int main() {
    double grid_scale = 0.004f;
    SPHSystem sphSystem = SPHSystem(50, 30, 1.0, 0.004f, 1.0f, 1000.0f, 0.01f, grid_scale);
    Particle p = Particle {.pos = {.x = 0.0, .y = 0.0}, .v = {.x = 0.0, .y = 0.0}, .dens = 1000.0f, .type = NORMAL };

    // 生成两堆液体
    for (int y = 0; y < 8; y++) {
        for (int x = 10; x < 30; x++) {
            p.pos.x = x * grid_scale;
            p.pos.y = y * grid_scale;
            sphSystem.add_particle(p);
        }
    }

    for (int y = 3; y < 11; y++) {
        for (int x = 40; x < 60; x++) {
            p.pos.x = x * grid_scale;
            p.pos.y = y * grid_scale;
            sphSystem.add_particle(p);
        }
    }

    for (;;) {
        sphSystem.update();
    }
}